<?php

namespace Modules\Article\Policies;

use App\User;
use Illuminate\Auth\Access\HandlesAuthorization;
use Modules\Article\Entities\Article;
class ArticlePolicy
{
    use HandlesAuthorization;

    /**
     * Create a new policy instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * 定义删除的权限策略
     * @param User $user  代表当前登录的操作者的数据对象
     * @param Article $model  代表需要被操作的数据对象
     * @return mixed
     */
    public function delete(User $user,Article $model){
        return $user->is_admin;
    }
}
